<form id="send-form" class="form-horizontal nice-validator n-default n-bootstrap" role="form" data-toggle="validator" method="POST" novalidate="novalidate">

    <fieldset>
        <legend>
            订单信息 
        </legend>

        <!-- 订单信息 -->
        <div class="col-md-10 col-md-offset-1 col-sm-12">
            <div class="box radius-none">
                <div class="box-header with-border">
                    订单编号：{$data.order_no} ( 下单时间 {$data.createtime|date="y-m-d H:i:s",###})
                </div>
                <div class="box-body">
                    <div class="panel panel-default">
                      <div class="panel-heading">商品详情 运费：{$data.fee}</div>
                      <table class="table">
                        <tbody>
                            <input type="hidden" name="order_id" value="{$data.id}">
                            {if condition="isset($data.goods_list)"}

                                {volist name="data.goods_list" id="vo"}
                                    <tr>
                                        <td>{$vo.goods_name}</td>
                                        <td>{$vo.goods_attr}</td>
                                        {if condition="$data.order_status eq 50"}
                                            <td>单价:<input type="number" data-rule="required"  name="unit_price[]"></td>
                                            {else/}
                                            <td>单价:{$vo.unit_price}</td>
                                        {/if}
                                        <td>运费:{$vo.fee} 元</td>
                                        <td>重量:{$vo.zhongliang}kg</td>
                                        <td>数量:{$vo.num}</td>
                                    </tr>
                                {/volist}

                            {else/}

                            <tr>
                              <td>{$data.goods_name}</td>
                              <td>{$data.goods_attr}</td>

                              {if condition="$data.order_status eq 50"}
                              <td>单价: <input type="number" data-rule="required" name="unit_price"> </td>
                              {else/}
                              <td>单价: {$data.unit_price}</td>
                              {/if}
                              <td>数量:{$data.num}</td>
                              <td>运费:{$data.fee} 元</td>
                              <td>重量:{$data.zhongliang} kg</td>
                            </tr>
                            
                            {/if}
                        </tbody>
                    </table>

                    </div>

                    {if condition="($data.order_status neq '50')    "}
                    <div class="row" style="margin:1em 0;">
                        <div class="col-md-4 padding">
                            <span class="label label-danger">支付状态</span> : 
                            {if condition="$data.pay_status eq '10'"}
                                未支付
                            {else/} 
                                已支付
                            {/if}  
                        </div>
                        <div class="col-md-4 padding">
                            <span class="label label-danger">支付时间</span> : {if condition="($data.pay_time) neq '0'"}{$data.pay_time|date="Y-m-d H:i:s",###}{/if}</div>
                        <div class="col-md-4 padding">
                            <span class="label label-danger">总金额</span> : {$data.total_price} </div>
                    </div>
                    {if condition="$data.delivery_methods neq 20"}

                    <div class="row" style="margin:1em 0;">

                        <div class="col-md-4 padding">
                            <span class="label label-success">发货时间</span> :  {if condition="isset($data.delivery_time)"}{$data.delivery_time|date="Y-m-d H:i:s",###}{/if}
                        </div>
                        <div class="col-md-4 padding">
                            <span class="label label-success">快递公司</span> : {$data.company}
                        </div>
                        <div class="col-md-4 padding">
                            <span class="label label-success">快递单号</span> : {$data.track_number}
                        </div>

                    </div>
                    {/if}
                    <div class="row" style="margin:1em 0;">
                    
                        <div class="col-md-4 padding">
                            <span class="label label-info">订单状态</span> :
                            <!-- 订单状态:10=未支付,20=已支付待发货,30=已发货,40=确认收货 -->
                                {switch name="data.order_status"}
                                    {case value="10"}未支付{/case}
                                    {case value="20"}已支付待发货{/case}
                                    {case value="30"}已发货{/case}
                                    {case value="40"}确认收货{/case}
                                    {case value="50"}待报价{/case}
                                {/switch}
                        </div>

                        <div class="col-md-4 padding">
                            <span class="label label-info">送货方式</span> :
                            <!-- 送货方式:10=送货上门,20=门店自提 -->
                                {switch name="data.delivery_methods"}
                                    {case value="10"}送货上门{/case}
                                    {case value="20"}门店自提{/case}
                                {/switch}
                        </div>

                        {if condition="$data.delivery_methods eq 20"}
                        <div class="col-md-4 padding">
                            <span class="label label-info">门店名称</span> :{$data.title}
                            </div>

                            <div class="col-md-4 padding">
                            <span class="label label-info">门店详细地址</span> :{$data.detail}
                            </div>
                            
                            <div class="col-md-4 padding">
                            <span class="label label-info">提货码</span> :{$data.code}
                            </div>
                        {/if}
                    </div>
                    {/if}

                    <div class="col-md-12 padding">
                        <fieldset>
                            <legend><h4>收货人信息</h4></legend>
                            <div class="col-md-6 padding">
                                省 / 市 / 区: {$data.address.province} / {$data.address.city} / {$data.address.region}                           </div>
                            <div class="col-md-6 padding">
                                具体地址: {$data.address.detail}                          </div>
                            <div class="col-md-6 padding">
                                联系人:{$data.address.name}                          </div>
                            <div class="col-md-6 padding">
                                联系电话: {$data.address.phone}                           </div>
                        </fieldset>
                    </div>
                   
                </div>
            </div>
        </div>

    

        <!-- 订单信息 -->
    </fieldset>

 {if condition="($data.order_status neq '50') and ($data.order_status neq '10') and ($data.delivery_methods neq '20')"}
    <fieldset>
        <legend><h4>发货信息</h4></legend>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">快递公司:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-company" class="form-control" name="company" type="text" value="{$data.company}">
                    <input type="hidden" name="row[id]" value="{$order_id}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">快递单号:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-track_number" class="form-control" name="track_number" type="text" value="{$data.track_number}">
                </div>
            </div>
    </fieldset>
    {/if}

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            {if condition="($data.order_status eq 20) and ($data.delivery_methods eq 20)"}
                <button type="submit" class="btn btn-success btn-embossed disabled">发货确认，并且自动生成提货码</button>
            {elseif condition="($data.order_status eq 30) and ($data.delivery_methods eq 20)"}
            <button type="submit" class="btn btn-success btn-embossed disabled">上门提货确认</button>
            {else/}
            {switch name="$data.order_status" }{case value="50"}<button type="submit" class="btn btn-success btn-embossed disabled">报价提交</button>{/case}{case value="20"}<button type="submit" class="btn btn-success btn-embossed disabled">发货提交</button>{/case}{default /}{/switch}
            {/if}



        </div>

    </div>
</form>